from django.shortcuts import render, get_object_or_404
from training.models import *


def index(request):
    last_training_project = Project.objects.order_by('begin_time')[0:10]
    context = {'last_training_project': last_training_project}
    return render(request, 'training/index.html', context)


def project_show(request, project_id):
    project = get_object_or_404(Project, pk=project_id)
    return render(request, 'training/project/show.html', {'project': project})

